import request from '@/utils/request'

export function getFrontCourses() {
    return request({
        url: `/course/front/course/index`,
        method: 'get'
    })
}

export function pageCourse(pageCourseVo, current, limit) {
    return request({
        url: `/course/course/pageCourse/${current}/${limit}`,
        method: 'post',
        data: pageCourseVo
    })
}

export function getCourseById(id, isContainChapter, isContainComment) {
    return request({
        url: `/course/course/getCourseById/${id}`,
        method: 'get',
        params: { isContainChapter, isContainComment }
    })
}

export function getTeacherCourses(teacherId) {
    return request({
        url: `/course/front/course/getTeacherCourses/${teacherId}`,
        method: 'get',

    })
}

export function pageCourseOfUser(current, limit) {
    return request({
        url: `/course/front/course/pageCourseOfUser/${current}/${limit}`,
        method: 'get',
    })
}